<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch"
             label-width="68px">


      <el-form-item label="当前求职状态" prop="currentJobStatus">
        <el-input v-model="queryParams.currentJobStatus" placeholder="请输入当前求职状态" clearable
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>


      <el-form-item label="求职类型" prop="jobType">
        <el-input v-model="queryParams.jobType" placeholder="请输入求职类型" clearable
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>

      <el-form-item label="薪资要求" prop="salaryRequirements">
        <el-input v-model="queryParams.salaryRequirements" placeholder="请输入薪资要求" clearable
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>

      <el-form-item label="工作城市" prop="workCity">
        <el-input v-model="queryParams.workCity" placeholder="请输入工作城市" clearable
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>
      <el-form-item label="期望行业" prop="expectedIndustry">
        <el-input v-model="queryParams.expectedIndustry" placeholder="请输入期望行业" clearable
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>


      <el-form-item label="拥有技能" prop="haveSkills">
        <el-input v-model="queryParams.haveSkills" placeholder="请输入拥有技能" clearable
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>


      <el-form-item label="学历" prop="education">
        <el-input v-model="queryParams.education" placeholder="请输入学历" clearable
                  @keyup.enter.native="handleQuery"/>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd"
                   v-hasPermi="['system:resume:add']">新增
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single" @click="handleUpdate"
                   v-hasPermi="['system:resume:edit']">修改
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
                   @click="handleDelete" v-hasPermi="['system:resume:remove']">删除
        </el-button>
      </el-col>

      <el-col :span="1.5">
        <el-button type="success" plain icon="el-icon-position" size="mini" :disabled="multiple" @click="batchPushs"
                   v-hasPermi="['system:resume:batchPush']">推送
        </el-button>
      </el-col>


      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>
    <el-table v-loading="loading" :data="resumeList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="序号" align="center" prop="id"/>
      <el-table-column label="姓名" align="center" prop="name"/>
      <el-table-column label="电话" align="center" prop="phone"/>
      <el-table-column label="参加工作时间" align="center" prop="workingTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.workingTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="当前求职状态" align="center" prop="currentJobStatus"/>
      <el-table-column label="职场人" align="center" prop="workplacePeople"/>
      <el-table-column label="薪资要求" align="center" prop="salaryRequirements"/>
      <el-table-column label="工作城市" align="center" prop="workCity"/>
      <el-table-column label="在职时间" align="center" prop="serviceTime" width="180">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.serviceTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="拥有技能" align="center" prop="haveSkills"/>


      <el-table-column label="推送状态" align="center" prop="state">
        <template scope="scope">
          <p v-if="scope.row.state==0">待推送</p>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center">
        <template slot-scope="scope">


          <el-button type="text" icon="el-icon-position" @click="pushOpen(scope.row)">推送</el-button>
          <el-button size="mini" type="text" icon="el-icon-error" @click="handleDeletes(scope.row)"
                     v-hasPermi="['system:resume:remove']">淘汰
          </el-button>
          <el-button type="text" icon="el-icon-loading" @click="pushDetails(scope.row.id)" v-hasPermi="['system:resume:query']">详细信息
          </el-button>
        </template>

      </el-table-column>
    </el-table>

    <pagination v-show="total>0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
                @pagination="getList"/>

    <!-- 添加或修改【请填写功能名称】对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="1400px" append-to-body>
      <el-upload
        icon="el-icon-upload"
        ref="uploadRef"
        action=""
        accept=".pdf"
        :auto-upload="false"
        :on-change="handlerChangeTest"
        :show-file-list="false"
      >
        <i class="el-icon-upload el-icon--right"></i>
        <el-button
          type="primary"
          size="mini"
        >上传
        </el-button>
      </el-upload>
      <el-form ref="form" :model="form" :rules="rules" label-width="100px">
        <el-row >

          <el-col :span="6">
            <el-form-item label="姓名" prop="name">
              <el-input v-model="form.name"   placeholder="请输入姓名"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="生日" prop="birthday">
              <el-date-picker clearable v-model="form.birthday" type="date" value-format="yyyy-MM-dd"
                              placeholder="请选择生日">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="性别" prop="sex">
              <el-input v-model="form.sex" placeholder="性别"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="电话" prop="phone">
              <el-input v-model="form.phone" placeholder="请输入电话"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="学历" prop="education">
              <el-input v-model="form.education" placeholder="请输入学历"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="专业" prop="major">
              <el-input v-model="form.major" placeholder="请输入专业"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="职场人" prop="workplacePeople">
              <el-input v-model="form.workplacePeople" placeholder="请输入职场人(我的牛人身份)"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="期望职位" prop="expectedPosition">
              <el-input v-model="form.expectedPosition" placeholder="请输入期望职位"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="薪资要求" prop="salaryRequirements">
              <el-input v-model="form.salaryRequirements" placeholder="请输入薪资要求"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="工作城市" prop="workCity">
              <el-input v-model="form.workCity" placeholder="请输入工作城市"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="期望行业" prop="expectedIndustry">
              <el-input v-model="form.expectedIndustry" placeholder="请输入期望行业"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="公司名称" prop="corporateName">
              <el-input v-model="form.corporateName" placeholder="请输入公司名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属部门" prop="department">
              <el-input v-model="form.department" placeholder="请输入所属部门"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="在职时间" prop="serviceTime">
              <el-date-picker clearable v-model="form.serviceTime" type="date" value-format="yyyy-MM-dd"
                              placeholder="请选择在职时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="所属行业" prop="industry">
              <el-input v-model="form.industry" placeholder="请输入所属行业"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="职位名称" prop="positionName">
              <el-input v-model="form.positionName" placeholder="请输入职位名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="项目名称" prop="entryName">
              <el-input v-model="form.entryName" placeholder="请输入项目名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="项目角色" prop="projectRole">
              <el-input v-model="form.projectRole" placeholder="请输入项目角色"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="开始时间" prop="startTime">
              <el-date-picker clearable v-model="form.startTime" type="date" value-format="yyyy-MM-dd"
                              placeholder="请选择开始时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="结束时间" prop="endTime">
              <el-date-picker clearable v-model="form.endTime" type="date" value-format="yyyy-MM-dd"
                              placeholder="请选择结束时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="学校名称" prop="schoolName">
              <el-input v-model="form.schoolName" placeholder="请输入学校名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label="学制类型" prop="typeSchooling">
              <el-input v-model="form.typeSchooling" placeholder="请输入学制类型"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item  label=" 参加工作时间" prop="workingTime">
              <el-date-picker clearable v-model="form.workingTime" type="date" value-format="yyyy-MM-dd"
                              placeholder="请选择参加工作时间">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="拥有技能" prop="haveSkills">
              <el-input
                type="textarea"
                :autosize="{ minRows: 2, maxRows: 4}"
                placeholder="请输入拥有技能"
                v-model="form.haveSkills">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="个人优势" prop="personalAdvantages">
              <el-input
                type="textarea"
                :autosize="{ minRows: 2, maxRows: 4}"
                placeholder="请输入个人优势"
                v-model="form.personalAdvantages">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="项目描述" prop="projectDescription">
              <el-input
                type="textarea"
                :autosize="{ minRows: 2, maxRows: 4}"
                placeholder="请输入项目描述"
                v-model="form.projectDescription">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="工作内容" prop="jobContent">
              <el-input
                type="textarea"
                :autosize="{ minRows: 2, maxRows: 4}"
                placeholder="请输入工作内容"
                v-model="form.jobContent">
              </el-input>
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>


    <el-dialog :title="title" :visible.sync="dialogFormVisible" width="500px" append-to-body>
      <!-- <el-dialog title="推送" :visible.sync="dialogFormVisible"> -->
      <el-form ref="form" :model="formStation" :rules="rules" label-width="80px">
        <el-select v-model="formStation.id" placeholder="请选择岗位">
          <el-option v-for="item in stationList" :key="item.id" :label="item.stationName" :value="item.id"></el-option>
        </el-select>

        <el-select v-model="formStation.id" align="center" placeholder="请选择公司">
          <el-option v-for="item in stationList" :key="item.id" :label="item.residentEnterprises" :value="item.id"></el-option>
        </el-select>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="pushForm()">确 定 推 送</el-button>
      </div>
    </el-dialog>
    <el-dialog :title="title" :visible.sync="dialogFormVisibles" width="500px" append-to-body>
      <el-form ref="form" :model="formStation" :rules="rules" label-width="80px">
        <el-select v-model="formStation.id" placeholder="请选择岗位">
          <el-option v-for="item in stationList" :key="item.id" :label="item.stationName" :value="item.id"></el-option>
        </el-select>

        <el-select v-model="formStation.id" align="center" placeholder="请选择公司">
          <el-option v-for="item in stationList" :key="item.id" :label="item.residentEnterprises" :value="item.id"></el-option>
        </el-select>


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogFormVisibles = false">取 消</el-button>
        <el-button type="primary" @click="batchPushss">确 定 推 送</el-button>
      </div>
    </el-dialog>


    <el-dialog :title="title" column="{ xs: 8, sm: 16, md: 24}" :visible.sync="videoVisible" width="80%"
               append-to-body>
      <el-tag>待推送简历信息</el-tag>
      <el-descriptions title="个人信息">
        <el-descriptions-item label="姓名">{{ queryParams.name }}</el-descriptions-item>
        <el-descriptions-item label="生日">{{ queryParams.birthday }}</el-descriptions-item>
        <el-descriptions-item label="性别">{{ queryParams.sex }}</el-descriptions-item>
        <el-descriptions-item label="电话">{{ queryParams.phone }}</el-descriptions-item>
        <el-descriptions-item label="参加工作时间">{{ queryParams.workingTime }}</el-descriptions-item>
        <el-descriptions-item label="当前求职状态">{{ queryParams.currentJobStatus }}</el-descriptions-item>
        <el-descriptions-item label="职场人">{{ queryParams.workplacePeople }}</el-descriptions-item>
        <el-descriptions-item label="求职类型">{{ queryParams.jobType }}</el-descriptions-item>
        <el-descriptions-item label="期望职位">{{ queryParams.expectedPosition }}</el-descriptions-item>
        <el-descriptions-item label="薪资要求">{{ queryParams.salaryRequirements }}</el-descriptions-item>
        <el-descriptions-item label="工作城市">{{ queryParams.workCity }}</el-descriptions-item>
        <el-descriptions-item label="期望行业">{{ queryParams.expectedIndustry }}</el-descriptions-item>
        <el-descriptions-item label="所属部门">{{ queryParams.corporateName }}</el-descriptions-item>
        <el-descriptions-item label="在职时间">{{ queryParams.serviceTime }}</el-descriptions-item>
        <el-descriptions-item label="所属行业">{{ queryParams.industry }}</el-descriptions-item>
        <el-descriptions-item label="职位名称">{{ queryParams.positionName }}</el-descriptions-item>
        <el-descriptions-item label="项目名称">{{ queryParams.entryName }}</el-descriptions-item>
        <el-descriptions-item label="项目角色">{{ queryParams.projectRole }}</el-descriptions-item>
        <el-descriptions-item label="开始时间">{{ queryParams.startTime }}</el-descriptions-item>
        <el-descriptions-item label="结束时间">{{ queryParams.endTime }}</el-descriptions-item>
        <el-descriptions-item label="学校名称">{{ queryParams.schoolName }}</el-descriptions-item>
        <el-descriptions-item label="学制类型">{{ queryParams.typeSchooling }}</el-descriptions-item>
        <el-descriptions-item label="学历">{{ queryParams.education }}</el-descriptions-item>
        <el-descriptions-item label="专业">{{ queryParams.major }}</el-descriptions-item>
        <el-descriptions-item label="简历创建时间">{{ queryParams.birthday }}</el-descriptions-item>
        <el-descriptions-item label="简历跟新时间">{{ queryParams.birthday }}</el-descriptions-item>
        <el-descriptions-item label="创建人ID">{{ queryParams.creator }}</el-descriptions-item>
      </el-descriptions>

      <el-descriptions>
        <el-descriptions-item label="拥有技能" span="18">
          <span>{{ queryParams.haveSkills }}</span>
        </el-descriptions-item>
        <el-descriptions-item label="个人优势" span="18">
          <span>{{ queryParams.personalAdvantages }}</span>
        </el-descriptions-item>
        <el-descriptions-item label="项目描述" span="18">
          <span>{{ queryParams.jobType }}</span>
        </el-descriptions-item>
        <el-descriptions-item label="工作内容" span="18">
          <span>{{ queryParams.jobContent }}</span>
        </el-descriptions-item>
      </el-descriptions>
    </el-dialog>

  </div>
</template>

<script>
import {
  listResume,
  getResume,
  delResume,
  addResume,
  updateResume,
  addPush,
  listStation,
  batchPush,
  uploadFile,
  uploadFilePDF
} from "@/api/system/resume";
import {getToken} from "@/utils/auth";
import {
  exportPDF
} from "@/api/system/exportPDF";

export default {
  name: "Resume",
  data() {
    return {
      // 遮罩层
      loading: true,

      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,

      value1: '',
      // 【请填写功能名称】表格数据
      resumeList: [],

      stationList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,

      dialogFormVisible: false,
      dialogFormVisibles: false,
      videoVisible: false,
      // 岗位详情
      stationParams: {
          id: null,
          residentEnterprises: null,
          stationName: null,
          stationBackground: null,
          stationWork: null,
          stationQuantity: null,
          workData: null,
          minimumWage: null,
          highestSalary: null,
          negotiable: null,
          stationEndtimt: null,
          beginTime: null,
          endTime: null,
          workPlace: null,
          jobResponsibilities: null,
          jobRequirements: null,

      },
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        id: null,
        name: null,
        birthday: null,
        sex: null,
        phone: null,
        workingTime: null,
        currentJobStatus: null,
        workplacePeople: null,
        personalAdvantages: null,
        jobType: null,
        expectedPosition: null,
        salaryRequirements: null,
        workCity: null,
        expectedIndustry: null,
        corporateName: null,
        department: null,
        serviceTime: null,
        industry: null,
        positionName: null,
        jobContent: null,
        haveSkills: null,
        entryName: null,
        projectRole: null,
        startTime: null,
        endTime: null,
        projectDescription: null,
        schoolName: null,
        typeSchooling: null,
        education: null,
        major: null,
        createTime: null,
        updateTime: null,
        creator: null,
        isDelete: null,
        state: null
      },
      // 岗位详情
      ItoStation: {
        id: null,
        residentEnterprises: null,
        stationName: null,
        stationBackground: null,
        stationWork: null,
        stationQuantity: null,
        workData: null,
        minimumWage: null,
        highestSalary: null,
        negotiable: null,
        stationEndtimt: null,
        beginTime: null,
        endTime: null,
        workPlace: null,
        jobResponsibilities: null,
        jobRequirements: null,
      },
      // 用户导入参数
      upload: {
        // 是否显示弹出层（用户导入）
        open: false,
        // 弹出层标题（用户导入）
        name: "",
        // 是否禁用上传
        isUploading: false,
        // 是否更新已经存在的用户数据
        updateSupport: 0,
        // 设置上传的请求头部
        headers: {Authorization: "Bearer " + getToken()},
        // 上传的地址
        url: process.env.VUE_APP_BASE_API + "/system/resume/importData"
      },
      queryPush: {
        pageNum: 1,
        pageSize: 10,
        rid: null,
        pid: null,
        uid: null,
        oneSide: null,
        twoSide: null,
        isDelete: null
      },
      rids: {},
      pid: null,
      // 表单参数
      form: {
        name: ''
      },
      // 表单校验
      rules: {},

      formStation: {},
    };
  },
  created() {
    this.getList();
    this.getStation();
    this.carryToken();
  },
  methods: {
    /** 查询简历列表 */
    getList() {
      this.loading = true;
      listResume(this.queryParams).then(response => {
        this.resumeList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    getStation() {
      this.loading = true;
      listStation(this.stationParams).then(response => {
        this.stationList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },


    btnClick(params) {
      // this.reset();
      // const id = row.id || this.ids
      exportPDF(params).then((res) => {
        //   console.log(id)
        //   this.form = res.data;
        //导出文件名
        const filename = "个人简历";
        //创建url
        let url = window.URL.createObjectURL(res)
        //创建a标签 并设置属性
        let link = document.createElement('a')
        link.style.display = 'none'
        link.href = url
        link.setAttribute('download', filename + '.pdf')
        //添加a标签
        document.body.appendChild(link)
        //执行下载
        link.click();
        //释放url对象
        URL.revokeObjectURL(link.href);
        //释放a标签
        document.body.removeChild(link);

      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        id: null,
        name: null,
        birthday: null,
        sex: null,
        phone: null,
        workingTime: null,
        currentJobStatus: "0",
        workplacePeople: null,
        personalAdvantages: null,
        jobType: null,
        expectedPosition: null,
        salaryRequirements: null,
        workCity: null,
        expectedIndustry: null,
        corporateName: null,
        department: null,
        serviceTime: null,
        industry: null,
        positionName: null,
        jobContent: null,
        haveSkills: null,
        entryName: null,
        projectRole: null,
        startTime: null,
        endTime: null,
        projectDescription: null,
        schoolName: null,
        typeSchooling: null,
        education: null,
        major: null,
        createTime: null,
        updateTime: null,
        creator: null,
        isDelete: null,
        state: null
      };
      this.resetForm("form");

      this.formPush = {
        id: null,
        rid: null,
        pid: null,
        uid: null,
        oneSide: null,
        twoSide: null,
        createTime: null,
        updateTime: null,
        isDelete: null
      };
      this.resetForm("formPush");
      this.formStation = {
        id: null,
        jobTitle: null,
        jobCategory: null,
        jobDescription: null,
        jobLevel: null,
        billingMethod: null,
        degree: null,
        experience: null,
        wages: null,
        type: null,
        companyName: null,
        workAddress: null,
        companyTelephone: null,
        companyBenefits: null,
        number: null,
        createId: null,
        updateId: null,
        createTime: null,
        updateTime: null,
        startTime: null,
        endTime: null,
        workDeadline: null,
        status: 0,
        isDelete: null
      };
      this.resetForm("formStation");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    handleChange(file) {
      console.log(file)
      if (file != null) {
        let formData = new FormData();
        formData.append('file', file.raw)
        uploadFile(formData).then(response => {
          console.log(response)
          this.$modal.msgSuccess("上传成功！");
        });
      }
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.id)
      this.single = selection.length !== 1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加简历";
    },

    /** 推送按钮操作 */
    pushOpen(row) {
      this.reset();
      this.formPush.rid = row.id;
      this.dialogFormVisible = true;
      this.title = "请按照类型选择并进行推送的";

    },
    /** 批量推送按钮操作 */
    batchPushs(row) {
      this.reset();
      this.formPush.rid = row.id;
      this.dialogFormVisibles = true;
      this.title = "请按照类型选择并进行推送的";
      // this.getList();
      // this.btnClick(this.queryParams);

    },
    /** 批量推送提交按钮 */
    batchPushss() {
      this.formPush.pid = this.formStation.id;
      this.rids = this.ids;
      batchPush(this.ids, this.formPush.pid).then(response => {
        this.$modal.msgSuccess("推送成功");
        this.dialogFormVisibles = false;
        // this.btnClick(this.queryParams);
      });
      this.getStation();
      this.getList();
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const id = row.id || this.ids
      getResume(id).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改简历";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.id != null) {
            updateResume(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addResume(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 推送提交按钮 */
    pushForm() {
      this.formPush.pid = this.formStation.id;
      this.form.id = this.formPush.rid
      addPush(this.formPush).then(response => {
        this.$modal.msgSuccess("推送成功");
        this.dialogFormVisible = false;
        this.getList();
        console.log(this.queryParams);
        this.btnClick(this.form);
      });
    },
    // /** 详情按钮 */
    // pushDetails(id) {
    //   this.getList(id).then(response => {
    //     this.queryParams=response.data();
    //     this.videoVisible=true
    //   });
    // },
    // /** 详情按钮 */
    // pushDetails(row) {
    //   this.reset();
    //   const id = row.id || this.ids
    //   getResume(id).then(response => {
    //     this.form = response.data;
    //     this.videoVisible = true;
    //     this.title = "简历详细信息";
    //   });
    // },
    /** 详情按钮操作 */
    //点击按钮时,触发弹出效果
    pushDetails(id) {
      getResume(id).then(response => {
        this.queryParams = response.data;
        this.videoVisible = true
        this.title = "简历详细信息";
      });
    },


    /** 导入按钮操作 */
    handleImport() {
      this.download('system/files/uploadFile', {
        ...this.queryParams
      }, `resume_${new Date().getTime()}.pdf`)
      this.upload.name = "简历导入";
      this.upload.open = true;

    },


    /** 删除按钮操作 */
    handleDelete(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认删除简历编号为"' + ids + '"的数据项？').then(function () {
        return delResume(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {
      });
    },
    /** 淘汰按钮操作 */
    handleDeletes(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认淘汰简历编号为"' + ids + '"的数据项？').then(function () {
        return delResume(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("淘汰成功");
      }).catch(() => {
      });
    },
    /** 淘汰按钮操作 */
    handleEliminate(row) {
      const ids = row.id || this.ids;
      this.$modal.confirm('是否确认要淘汰的简历,编号为"' + ids + '"的数据项？').then(function () {
        return eliResume(ids);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("淘汰成功");
      }).catch(() => {
      });
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/resume/export', {
        ...this.queryParams
      }, `resume_${new Date().getTime()}.pdf`)
    },
    //token
    carryToken() {
      this.token = getToken();
    },
    //上传
    handleRemove(file, fileList) {
      console.log(file, fileList);
    },
    handlePreview(file) {
      console.log(file);
    },
    handleExceed(files, fileList) {
      this.$message.warning(`当前限制选择 3 个文件，本次选择了 ${files.length} 个文件，共选择了 ${files.length + fileList.length} 个文件`);
    },
    beforeRemove(file, fileList) {
      return this.$confirm(`确定移除 ${file.name}？`);
    },
    handlerChangeTest(file) {
      console.log(file)
      if (file != null) {
        let formData = new FormData();
        formData.append('file', file.raw)
        uploadFilePDF(formData).then(response => {
          console.log(response)
          //回显数据
          this.form.birthday = response.data.birthday;
          this.form.education = response.data.education;
          this.form.expectedPosition = response.data.expectedPosition;
          this.form.jobContent = response.data.jobContent;
          this.form.major = response.data.major;
          this.form.name = response.data.name;
          this.form.personalAdvantages = response.data.personalAdvantages;
          this.form.projectDescription = response.data.projectDescription;
          this.form.salaryRequirements = response.data.salaryRequirements;
          this.form.schoolName = response.data.schoolName;
          this.form.sex = response.data.sex;
          this.form.typeSchooling = response.data.typeSchooling;
          this.form.workCity = response.data.workCity;
          this.form.workingTime = response.data.workingTime;
          this.form.phone = response.data.phone;
        });
      }
    }
  }
};
</script>
